package com.wdf.pojo.query;

import io.micrometer.common.util.StringUtils;
import lombok.Data;

@Data
public class PageQuery {
    private Integer pageNum = 1;
    private Integer pageSize = 10;
    /**
     * 排序字段
     */
    private String sortBy;
    /**
     * 排序方向
     */
    private String sortDirection;
    public String getOrderBy(){
        if(StringUtils.isNotBlank(sortBy)){
            return sortBy + " " +
                    (StringUtils.isBlank(sortDirection)?"ASC":sortDirection);
        }
        return null;
    }
}
